<template>
	<view class="my-search-container" :style="{'background-color':bgcolor}" @click=searchBoxHandler>
		<view class="my-search-box" :style="{'border-radius':radius+'px'}">
			<uni-icons type='search' size='17'></uni-icons>
			<text>搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		props:{
			//背景颜色
			bgcolor:{
				type:String,
				default:'#C00000'
			},
			radius:{
				type:Number,
				default:15
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			searchBoxHandler(){
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss">
.my-search-container{
	width: 100%;
	height: 50px;
	// background-color: #C00000;
	position: relative;
}
.my-search-box{
	width: 70%;
	height: 30px;
	background-color: #ffffff;
	text-align: center;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translateY(-50%) translateX(-50%);
	text-align: center;
	line-height: 30px;
	// border-radius: 15px;
	
}
</style>